-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ompi/request: Support non-PML persistent requests #3701
ompi/request: Support non-PML persistent requests #3701
Conversation
This commit adds the `req_start` member to the `ompi_request_t` struct. The `MPI_START` and `MPI_STARTALL` routines call this callback function instead of `MCA_PML_CALL(start(...))`. So components that return persistent request must set this member to their request objects. `mca_pml_base_module_t::pml_start` is not deleted because `MCA_PML_CALL(start(...))` is still used elsewhere across OMPI. Signed-off-by: KAWASHIMA Takahiro <[email protected]>
I certainly understand the benefit of moving the request_start into the base request. However, I don't see the point of having the prototype of this function with a count and an array of request, as in general we are not able to alter the order of requests in the user array. Do we really expect to find ranges of similar requests and start them together ? |
@bosilca Certainly the prototype of |
I have little doubt about the interest of having persistent requests. I was asking about the need to have the start function associated with a particular request having the count and array of requests arguments, instead of simply using a request. |
Let's assume:
In this situation, For optimization of 2., a function having only one request argument is not suited. My logic was:
Of course, there are other ways to associate a request with a startall function. enum persistent_module_type {
PERSISTENT_MODULE_TYPE_NULL,
PERSISTENT_MODULE_TYPE_PML,
PERSISTENT_MODULE_TYPE_COLL,
...
}
union persistent_module_t {
void *ptr;
mca_pml_base_module_t *pml;
mca_coll_base_module_t *coll;
....
}
struct ompi_request_t {
....
enum persistent_module_type module_type;
union persistent_module_t module;
}
int MPI_Startall(...)
{
union persistent_module_t module = { .ptr = NULL };
for (i = 0, j = -1; i < count; ++i) {
// Call a callback function per block of requests
// which belong to the same module
if (requests[i]->module.ptr != module.ptr && i != 0) {
switch (requests[i - 1]->module_type) {
case PERSISTENT_MODULE_TYPE_PML:
module.pml->start(i - j, requests + j);
break;
case PERSISTENT_MODULE_TYPE_COLL:
module.coll->start(i - j, requests + j);
break;
...
}
module.ptr = requests[i]->module.ptr;
j = i;
}
}
// the last requests block
switch (requests[i - 1]->module_type) {
case PERSISTENT_MODULE_TYPE_PML:
module.pml->start(i - j, requests + j);
break;
case PERSISTENT_MODULE_TYPE_COLL:
module.coll->start(i - j, requests + j);
break;
...
}
} Is there more smart solution? |
Right, this solution rely heavily on the assumption that the user will place the persistent requests in the array for startall based on their logical generator. That's the only point I was trying to make. |
Please update the padding for the predefined_request_t in request.h to reflect the addition of the extra function pointer. |
@bosilca Do we need to update the padding of Current definition in #define PREDEFINED_REQUEST_PAD 256
struct ompi_predefined_request_t {
struct ompi_request_t request;
char padding[PREDEFINED_REQUEST_PAD - sizeof(ompi_request_t)];
}; |
I think we concluded during the face-to-face meeting that there is no need to change the padding. |
This commit adds the
req_start
member to theompi_request_t
struct. TheMPI_START
andMPI_STARTALL
routines call this callback function instead ofMCA_PML_CALL(start(...))
. So components that return persistent request must set this member to their request objects.mca_pml_base_module_t::pml_start
is not deleted becauseMCA_PML_CALL(start(...))
is still used elsewhere across OMPI.This commit was a part of my PR #2758, which I want to pull when the MPI Forum decide to add the persistent collective to the MPI Standard. But it will be required to implement other persistent request features. So I want to merge this before #2758.
I want to discuss this code modification at the upcoming July 2017 OMPI developer's meeting.